<?php

class AccountController extends Core_Controller_Action 
{	
	public function init() {
		
	}
	public function indexAction(){
		$this->view->title = 'account';
		
	}
	public function editAction(){
		$this->view->title = 'edit';
		if( $this->_request->isPost() ) {
			$users = new Users();
			$user = $users->getItem($this->userData->u_id)->getFirst();
			$user->first_name 		= $this->_request->getParam( 'first_name', '');
			$user->last_name 		= $this->_request->getParam( 'last_name', '');
			$user->adress	 		= $this->_request->getParam( 'adress', '');
			$user->city		 		= $this->_request->getParam( 'city', '');
			$user->country	 		= $this->_request->getParam( 'country', '');
			$user->email	 		= $this->_request->getParam( 'email', '');
			$user->phone	 		= $this->_request->getParam( 'phone', '');
			$user->phone2	 		= $this->_request->getParam( 'phone2', '');
			$user->save();
			$this->_redirect( 'account' );
		}
	}
}